package practica6;

import java.util.LinkedList;
import java.util.List;

import framework.IRule;

public class ReglaAv1 implements IRule<StateB> {

    @Override
    public List<StateB> apply(StateB state) {
	int y = 1;state.posX();
	int x = 1;state.posY();
//	System.out.println( "aplicando regla..");
	List<StateB> states = new LinkedList<StateB>();
	StateB newState1 = new StateB();
	newState1.clone();
	newState1.moveDown(x,y);
	StateB newState2 = new StateB();
	newState2.clone();
	newState2.moveUp(x,y);
	StateB newState3 = new StateB();
	newState3.clone();
	newState3.moveLeft(x,y);
	StateB newState4 = new StateB();
	newState4.clone();
	newState4.moveRigth(x,y);
	states.add(newState1);
	states.add(newState2);
	states.add(newState3);
	states.add(newState4);
	return states;
    }

    @Override
    public boolean isApplicable(StateB state) {
	return state.balVaciaIsCenter();
    }

}
